/**
 * Collaborative Story Development Web Application (CSDApp) 
 * Copyright Anton Strack 2014
 *
 * This file is part of Collaborative Story Development Application (CSDApp).
 *
 * CSDApp is free software: you can redistribute it and/or modify it under the
 * terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or any later version.
 *
 * CSDApp is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * CSDApp. If not, see <http://www.gnu.org/licenses/>.
 *
 */
package csdwa;

import java.sql.Timestamp;

/**
 * This class represents user definable templates for notifications. It
 * represents the template of a notification, not an individual notification
 * that is sent to a user.
 *
 * @author Anton Strack
 */
public class NotificationTemplate extends Resource {

    /**
     * The action type id that makes up part of the event the notification
     * system listens for. ActionId is a required part of the notification
     * event.
     */
    protected int actionId;
    /**
     * The state of the subjectResource that can specialize the notification
     * event to listen for a more specific event. SubjectStateId is a required
     * part of the notification event, but it has a wildcard state option.
     */
    protected int SubjectStateId;
    /**
     * The resource type id of the resource that is the subject of the actionId.
     * SubjectResourceTypeId is a required part of the notification event.
     */
    protected int subjectResourceTypeId;
    /**
     * The name of the Notification Template to display to end users.
     */
    protected String name;
    /**
     * A message to be sent with every notification to the user indicating the
     * event that occurred.
     */
    protected String message;
    /**
     * The user id of who created the notification template and thus who owns
     * it.
     */
    protected int createdById;
    /**
     * The timestamp the notification template was created.
     */
    protected Timestamp createdDate;
    /**
     * Indicate if a notification should be sent from this template to the a
     * registered user if that user created triggered the notification event.
     * False means the user won't receive notifications for events they created.
     */
    protected boolean includeCurrentUser;

    public NotificationTemplate() {
    }

    public NotificationTemplate(int resourceTypeId) {
        this.resourceTypeId = resourceTypeId;
    }

    /**
     * The action type id that makes up part of the event the notification
     * system listens for. ActionId is a required part of the notification
     * event.
     *
     * @return the actionId
     */
    public int getActionId() {
        return actionId;
    }

    /**
     * The action type id that makes up part of the event the notification
     * system listens for. ActionId is a required part of the notification
     * event.
     *
     * @param actionId the actionId to set
     */
    public void setActionId(int actionId) {
        this.actionId = actionId;
    }

    /**
     * The state of the subjectResource that can specialize the notification
     * event to listen for a more specific event. SubjectStateId is a required
     * part of the notification event, but it has a wildcard state option.
     *
     * @return the SubjectStateId
     */
    public int getSubjectStateId() {
        return SubjectStateId;
    }

    /**
     * The state of the subjectResource that can specialize the notification
     * event to listen for a more specific event. SubjectStateId is a required
     * part of the notification event, but it has a wildcard state option.
     *
     * @param SubjectStateId the SubjectStateId to set
     */
    public void setSubjectStateId(int SubjectStateId) {
        this.SubjectStateId = SubjectStateId;
    }

    /**
     * The resource type id of the resource that is the subject of the actionId.
     * SubjectResourceTypeId is a required part of the notification event.
     *
     * @return the subjectResourceTypeId
     */
    public int getSubjectResourceTypeId() {
        return subjectResourceTypeId;
    }

    /**
     * The resource type id of the resource that is the subject of the actionId.
     * SubjectResourceTypeId is a required part of the notification event.
     *
     * @param subjectResourceTypeId the subjectResourceTypeId to set
     */
    public void setSubjectResourceTypeId(int subjectResourceTypeId) {
        this.subjectResourceTypeId = subjectResourceTypeId;
    }

    /**
     * The name of the Notification Template to display to end users.
     *
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * The name of the Notification Template to display to end users.
     *
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * A message to be sent with every notification to the user indicating the
     * event that occurred.
     *
     * @return the message
     */
    public String getMessage() {
        return message;
    }

    /**
     * A message to be sent with every notification to the user indicating the
     * event that occurred.
     *
     * @param message the message to set
     */
    public void setMessage(String message) {
        this.message = message;
    }

    /**
     * The user id of who created the notification template and thus who owns
     * it.
     *
     * @return the createdById
     */
    public int getCreatedById() {
        return createdById;
    }

    /**
     * The user id of who created the notification template and thus who owns
     * it.
     *
     * @param createdById the createdById to set
     */
    public void setCreatedById(int createdById) {
        this.createdById = createdById;
    }

    /**
     * The timestamp the notification template was created.
     *
     * @return the createdDate
     */
    public Timestamp getCreatedDate() {
        return createdDate;
    }

    /**
     * The timestamp the notification template was created.
     *
     * @param createdDate the createdDate to set
     */
    public void setCreatedDate(Timestamp createdDate) {
        this.createdDate = createdDate;
    }

    /**
     * Indicate if a notification should be sent from this template to the a
     * registered user if that user created triggered the notification event.
     * False means the user won't receive notifications for events they created.
     *
     * @return the includeCurrentUser
     */
    public boolean isIncludeCurrentUser() {
        return includeCurrentUser;
    }

    /**
     * Indicate if a notification should be sent from this template to the a
     * registered user if that user created triggered the notification event.
     * False means the user won't receive notifications for events they created.
     *
     * @param includeCurrentUser the includeCurrentUser to set
     */
    public void setIncludeCurrentUser(boolean includeCurrentUser) {
        this.includeCurrentUser = includeCurrentUser;
    }
}
